package pailaidai.hc.com.mysvgdemo.artbookeview.remoteview;

import android.app.PendingIntent;
import android.content.Intent;
import android.os.Process;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.RemoteViews;

import pailaidai.hc.com.mysvgdemo.R;
import pailaidai.hc.com.mysvgdemo.activity.CameraActivity;

public class RemoteViewActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_remote_view);
    }


    private void setRemoteView() {
        RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.activity_radar_layout);
        remoteViews.setTextViewText(R.id.radr_text, "msg form process:" + Process.myPid());
        remoteViews.setImageViewResource(R.id.radr_image, R.mipmap.ic_launcher);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, CameraActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
        PendingIntent pendingIntent2 = PendingIntent.getActivity(this, 0, new Intent(this, CameraActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
        remoteViews.setOnClickPendingIntent(R.id.radr_button, pendingIntent);
        remoteViews.setOnClickPendingIntent(R.id.radr_layout,pendingIntent2);
        Intent intent=new Intent();
        intent.putExtra("",remoteViews);
        sendBroadcast(intent);
    }






}
